package cn.kfu.controller;

import cn.kfu.model.UserLoginLog;
import cn.kfu.service.UserLoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class PageController {

    @Autowired
    private UserLoginLogService userLoginLogService;

    @RequestMapping("toReg")
    public String register() {

        return "register";
    }

    @RequestMapping("toLogin")
    public String login() {
        return "login";
    }

    @RequestMapping("/")
    public String index(Model model) {
        List<UserLoginLog> list = userLoginLogService.findAll();
        model.addAttribute("list", list);
        return "index";
    }

}
